home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / qbbs / rakit1.zip / FDRA.BAT < prev    next >
DOS Batch File  |  1990-08-31  |  7KB  |  332 lines

  1. @echo off
  2.  cls
  3.  echo.
  4.  echo.
  5.  rem ... A FrontDoor/RemoteAccess batchfile by T. Graves - 159/500
  6.  rem ... set default drive here and before every questionable return to RA
  7.  rem ... in an interactive scenario like this, repeating the drive setting
  8.  rem ... is not overkill.
  9.  rem ... Note especially that this batch file may be restarted without the 
  10.  rem ... modem being re-initialized at any point in the batch file where 
  11.  rem ... there is a flag (ie: :HERE).  
  12.  rem ... If an outside function fails, you may restart your user by typing:
  13.  rem ... FDRA RESTART-RA and that will bring the same user right back online.
  14.  rem ... Every routine in this batch file may be tested the same way.
  15.  :c:
  16.  set RA=\RA
  17.  set FD=\FD
  18.  set DSZLOG=\RA\DSZ.LOG
  19.  if "%1." == "." goto start
  20.  dtr on >nul
  21.  goto %1
  22.  
  23. :START
  24.  dtr on >nul
  25.  at h1 >nul
  26.  cls
  27.  echo.
  28.  echo.
  29.  echo.
  30.  echo.
  31.  echo.
  32.  echo.
  33.  echo.
  34.  echo.
  35.  echo.
  36.  echo       -------------- FrontDoor ---- RemoteAccess ------------------
  37.  echo.
  38.  echo.
  39.  echo.
  40.  :c:
  41.  cd \RA
  42.  if not exist logon.flg goto runfdra
  43.  Setflags after AX-????-? >nul
  44.  del logon.flg
  45. :runfdra
  46.  cd \fd
  47.  FD 
  48. :AFTER-FD
  49.  if errorlevel 238 goto 19200_BBS
  50.  if errorlevel 219 goto 19200_BBS
  51.  if errorlevel 196 goto 9600_BBS
  52.  if errorlevel 124 goto 2400_BBS
  53.  if errorlevel 112 goto 1200_BBS
  54.  if errorlevel 103 goto 300_BBS
  55.  if errorlevel 100 goto LOCALBBS
  56.  if errorlevel  90 goto SCANECHO
  57.  if errorlevel  80 goto TOSSNET
  58.  if errorlevel  70 goto UNPACKMAIL
  59.  if errorlevel  60 goto CLEANUP
  60.  if errorlevel  55 goto DAILY
  61.  if errorlevel  50 goto RA
  62.  if errorlevel  11 goto START
  63.  if errorlevel  10 goto END
  64.  if errorlevel   6 goto FOSSIL
  65.  if errorlevel   5 goto MODEMINIT
  66.  if errorlevel   4 goto MODEMRESP
  67.  if errorlevel   3 goto FULLDISK
  68.  if errorlevel   2 goto EXTERNAL
  69.  if errorlevel   1 goto INTERNAL
  70.   goto start
  71.  
  72. rem ***** FrontDoor executes BBS for human callers baud rate/errorlevels *****
  73. :19200_BBS
  74.  :c:
  75.  cd\RA
  76.  echo .... User Logged On > logon.flg
  77.  RA.exe -n1 -b19200 -E0
  78.  goto AFTER-RA
  79.  
  80. :9600_BBS
  81.  :c:
  82.  cd\RA
  83.  echo .... User Logged On > logon.flg
  84.  RA.exe -n1 -b9600 -E0
  85.  goto AFTER-RA
  86.  
  87. :2400_BBS
  88.  :c:
  89.  cd\RA
  90.  echo .... User Logged On > logon.flg
  91.  RA.exe -n1 -b2400 -E0
  92.  goto AFTER-RA
  93.  
  94. :1200_BBS
  95.  :c:
  96.  cd\RA
  97.  echo .... User Logged On > logon.flg
  98.  RA.exe -n1 -b1200 -E0
  99.  goto AFTER-RA
  100.  
  101. :300_BBS
  102.  :c:
  103.  cd\RA
  104.  echo .... User Logged On > logon.flg
  105.  RA.exe -n1 -b300 -E0
  106.  goto AFTER-RA
  107.  
  108. :LOCALBBS
  109.  :c:
  110.  DTR ON >nul
  111.  AT M0H1 >nul
  112.  cd\RA
  113.  echo .... User Logged On > logon.flg
  114.  RA.exe -n1 -L -E0
  115.  goto AFTER-RA
  116.  
  117. :AFTER-RA
  118.  rem   ***** AFTER_RA traps the errorlevel exits from RA *****
  119.  if errorlevel 20 goto OUTSIDE
  120.  if errorlevel 10 goto START
  121.  if errorlevel  5 goto NET&ECHO
  122.  if errorlevel  4 goto ECHOONLY
  123.  if errorlevel  3 goto NETONLY
  124.  if errorlevel  1 echo INITIALIZATION ERROR!  Modem Init failed or NO FOSSIL!   
  125.   goto END-RA
  126.  
  127. :rem Outside routines requiring exit from RA to run (saves RAM).
  128. :rem -===========================================================-
  129.  
  130.  rem prevent accidental drop to DOS through batch
  131.  goto start
  132. :OUTSIDE
  133.  findcd 1
  134.  if errorlevel 0 goto tuit
  135.  xu watchcd:0:on
  136.  ctty gate1
  137. :tuit 
  138.  prompt Outside_(exit returns)$p$g 
  139.  c:\command.com
  140.  cd \RA
  141.  prompt $p$g
  142.  xu watchcd:0:off
  143.  ctty con 
  144.   goto restart-RA
  145.  
  146. :RESTART-RA
  147.  :c:
  148.  CD \RA
  149.  RA.exe -n1 -r 
  150.   goto AFTER-RA
  151.  
  152. :NET&ECHO
  153.  DTR ON  >nul
  154.  AT M0 >nul
  155.  AT H1 >nul
  156.  :c:
  157.  cd \RA
  158.  mbutil export
  159.  :mailscan 3
  160.  :
  161. :ECHOONLY
  162.  DTR ON  >nul
  163.  AT M0 >nul
  164.  AT H1 >nul
  165.  :c:
  166.  cd \RA
  167.  qecho -E -A -P
  168.  :ZMailQ EE EP PA NS
  169.  :echogen -E -A -P -S900
  170.   goto end-RA
  171.  
  172. :NETONLY
  173.  DTR ON >nul
  174.  AT M0 >nul
  175.  AT H1 >nul
  176.  :c:
  177.  cd \RA
  178.  mbutil export
  179.  :mailscan 3
  180.   goto end-RA
  181.  
  182. :END-RA
  183.  DTR ON >nul
  184.  AT M0 >nul
  185.  AT H1 >nul
  186.  cls
  187.  cd\ra
  188.  doink 
  189.   goto start
  190.  
  191. :UNPACKMAIL
  192.  :c:
  193.  cd\RA
  194.  echo **** Unpacking mail; exit from FD errorlvl 70;  F7 manually ****
  195.  qecho -A -H -S900 -T -U 
  196.  :ZMailQ PI PA PU EI EP EF NF NP
  197.  :EchoGen -B -P -T -U -A -H
  198.  mbutil import
  199.  if not exist \netfiles\nodediff.* goto nexttest
  200. :PARSE
  201.   echo    ........... Nodediff found... Processing Nodelist .......... 
  202.   cd \netfiles
  203.   for %%F IN (nodediff.???) Do Echo %%F Weekly Nodelist Change File >> \fidonet\files.bbs
  204.   cd \RA\nodelist
  205.   copy \netfiles\nodediff.* \fidonet 
  206.   pkunpak/r \netfiles\nodediff.*
  207.   del \netfiles\nodediff.*
  208.   parselst
  209.   del nodediff.*
  210.   pkzip -m \fidonet\nodelist.zbs nodelist.bbs
  211. :killist
  212.   cd \RA\nodelist
  213.   del nodelist.f*
  214.   killist
  215.   md temp
  216.   for %%F  in (nodelist.???) do zip \nodelist\temp\%%F nodelist.???
  217.   cd temp
  218.   rename nodelist.??? nodelist.z??
  219.   for %%F in (nodelist.???) do echo %%F Weekly Compiled Nodelist "Zipped" >> \fidonet\files.bbs
  220.   copy nodelist.??? \fidonet
  221.   del nodelist.???
  222.   cd \RA
  223.   RAnode
  224.   cd \fd
  225.   fdnc
  226. :nexttest
  227.   echo    ........... Checking for received File Lists ...............
  228.   if not exist d:\netfiles\f159_*.* goto nextst2
  229.   copy \netfiles\f159_*.* \fidonet
  230.   del \netfiles\f159_*.*
  231. :nextst2
  232.   goto START
  233.  
  234. :TOSSNET
  235.  :c:
  236.  cd\RA
  237.  echo **** Toss net-mail; Manual exit from FD Errorlvl 80  ****
  238.  mbutil import
  239.  goto START
  240.  
  241. :SCANECHO
  242.  :c:
  243.  cd\RA
  244.  echo ***** Echo Mail Scan; Manual exit from FD Errorlvl 90 *****
  245.  qecho -E -A -P
  246.  :echogen -E -A -P
  247.  :ZMailQ EE EP PA NS
  248.  goto START
  249.  
  250. :CLEANUP
  251.  :c:
  252.  cd\RA
  253.  echo **** Cleanup; Auto exit FD, 2am event FD Errorlvl 60 ****
  254.  mbutil import
  255.  mbutil export
  256.  qecho -E -A -P
  257.  :echogen -E -A -P
  258.  :ZMailQ EE EP PA NS
  259.  RAmsg -K
  260.  RAmsg -PKRA
  261.  RAuser -V -S -P -D90 -M50
  262.  goto start
  263.  
  264. :DAILY
  265.  echo * Special Daily Midnight Maintenance Routines  *
  266.  :c:
  267.  cd\RA
  268.  echo ..... GeneRAting daily files list with XLIST ....................
  269.  X_list XL_RA.Ctl
  270.  pkzip \fidonet\F159_999 f159_999.lst
  271.  echo ..... Reading System Log & Packing RA Daily Log .................
  272. : strip system.log
  273.  Daynbr ren system.log RAlog.@###
  274.  Daynbr pkzip -m \ra\logs\RAlog.zip RAlog.@###
  275.  :
  276.  cd\fd
  277.  echo.
  278.  echo ..... Packing FrontDoor Daily log................................. 
  279.  echo.
  280. : strip fd.log
  281.  Daynbr ren fd.log fdlog.@###
  282.  Daynbr pkzip -m \ra\logs\fdlog.zip fdlog.@###
  283.  :
  284. :dly
  285.  :c:
  286.  cd \RA
  287.  echo.
  288.  echo  ....  Packing RA RegistRAtion Answers ..................... 
  289.  echo.
  290.  Pkzip -u \ra\logs\answers.zip answers.dat
  291.  :
  292.  goto start
  293.  
  294.  rem ***** Some basic error codes in case we get in trouble *****
  295. :FOSSIL
  296.  echo.
  297.  echo.
  298.  Echo Wrong Fossil Version Error|goto END
  299. :MODEMINIT
  300.  echo.
  301.  echo.
  302.  Echo Unable To Initialize Modem|goto END
  303. :MODEMRESP
  304.  echo.
  305.  echo.
  306.  Echo Modem Not Responding|goto END
  307. :FULLDISK
  308.  echo.
  309.  echo.
  310.  Echo Insufficient Disk Space To Proceed|goto END
  311. :EXTERNAL
  312.  echo.
  313.  echo.
  314.  Echo External Error - System File Missing|goto END
  315. :INTERNAL
  316.  echo.
  317.  echo.
  318.  Echo Internal Error
  319. :END
  320.  cd \RA
  321.  DTR ON
  322.  AT M0
  323.  AT H1
  324.  AT M0
  325.  echo.
  326.  echo.
  327.  echo.
  328.  echo.
  329.  echo.
  330.  echo ...... outta there!
  331.  
  332.